<?php
/* @var $this VanbanController */
/* @var $model Vanban */
/* @var $form CActiveForm */
?>
<script src="<?php echo Yii::app()->baseUrl . '/ckeditor/ckeditor.js'; ?>"></script>
<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'vanban-_vanban-form',
	// Please note: When you enable ajax validation, make sure the corresponding
	// controller action is handling ajax validation correctly.
	// See class documentation of CActiveForm for details on this,
	// you need to use the performAjaxValidation()-method described there.
	'enableAjaxValidation'=>false,
    'htmlOptions' => array('enctype' => 'multipart/form-data'),
    
)); ?>

	

	<?php echo $form->errorSummary($model); ?>

	<div class="form_left">
        <?php echo $form->labelEx($model, 'url'); ?>
    </div>
    <div class="form_right">
        <?php echo $form->textField($model, 'url', array('size' => 70, 'maxlength' => 200, 'required' => 'required')); ?>
        <?php echo $form->error($model, 'url'); ?>
    </div>
    <div class="clear"></div>
    <div class="form_left">
        <?php echo $form->labelEx($model, 'title'); ?>
    </div>
    <div class="form_right">
        <?php echo $form->textField($model, 'title', array('size' => 70, 'maxlength' => 200, 'required' => 'required')); ?>
        <?php echo $form->error($model, 'title'); ?>
    </div>
    <div class="clear"></div>
    <div class="form_left">
        <?php echo $form->labelEx($model, 'thehanhnghe'); ?>
    </div>
    <div class="form_right">
        <?php echo $form->textField($model, 'thehanhnghe', array('size' => 70, 'maxlength' => 100)); ?>
        <?php echo $form->error($model, 'thehanhnghe'); ?>
    </div>
    <div class="clear"></div>
    <div class="form_left">
        <?php echo $form->labelEx($model, 'chungchi'); ?>
    </div>
    <div class="form_right">
        <?php echo $form->textField($model, 'chungchi', array('size' => 70, 'maxlength' => 100)); ?>
        <?php echo $form->error($model, 'chungchi'); ?>
    </div>
    <div class="clear"></div>
       <div class="form_left">
        <?php echo $form->labelEx($model, 'email'); ?>
    </div>
    <div class="form_right">
        <?php echo $form->textField($model, 'email', array('size' => 70, 'maxlength' => 300)); ?>
        <?php echo $form->error($model, 'email'); ?>
    </div>
    <div class="clear"></div>
       <div class="form_left">
        <?php echo $form->labelEx($model, 'fax'); ?>
    </div>
    <div class="form_right">
        <?php echo $form->textField($model, 'fax', array('size' => 70, 'maxlength' => 200)); ?>
        <?php echo $form->error($model, 'fax'); ?>
    </div>
    <div class="clear"></div>
       <div class="form_left">
        <?php echo $form->labelEx($model, 'phone'); ?>
    </div>
    <div class="form_right">
        <?php echo $form->textField($model, 'phone', array('size' => 70, 'maxlength' => 200, 'required' => 'required')); ?>
        <?php echo $form->error($model, 'phone'); ?>
    </div>
    <div class="clear"></div>
       <div class="form_left">
        <?php echo $form->labelEx($model, 'diachi'); ?>
    </div>
    <div class="form_right">
        <?php echo $form->textField($model, 'diachi', array('size' => 70, 'maxlength' => 300, 'required' => 'required')); ?>
        <?php echo $form->error($model, 'diachi'); ?>
    </div>
    <div class="clear"></div>
       <div class="form_left">
        <?php echo $form->labelEx($model, 'website'); ?>
    </div>
    <div class="form_right">
        <?php echo $form->textField($model, 'website', array('size' => 70, 'maxlength' => 200)); ?>
        <?php echo $form->error($model, 'website'); ?>
    </div>
    <div class="clear"></div>

    <div class="form_left">
        <?php echo $form->labelEx($model, 'meta'); ?>
    </div>
    <div class="form_right">
        <?php echo $form->textArea($model, 'meta', array('size' => 50, 'maxlength' => 500)); ?>
        <?php echo $form->error($model, 'meta'); ?>
    </div>
    <div class="clear"></div>
    <div class="form_left">
        <?php echo $form->labelEx($model, 'keywork'); ?>
    </div>
    <div class="form_right">
        <?php echo $form->textArea($model, 'keywork', array('size' => 50, 'maxlength' => 500)); ?>
        <?php echo $form->error($model, 'keywork'); ?>
    </div>
    <div class="clear"></div>
    <div class="form_left">
        <?php echo $form->labelEx($model, 'cateid'); ?>
    </div>
    <div class="form_right">
        <?php
        $category_ = Category::model()->findAll('cateid in(4,5,6,7,8) ');

        $arr = array();
        $lan = 0;
        foreach ($category_ as $item) {
            $lan = $lan + 1;
            $catelist = Category::model()->findAll('parent = ' . $item->cateid);

            $arr[$item->cateid] = $item->catename;

            foreach ($catelist as $it) {
                $arr[$it->cateid] = ' + ' . $it->catename;
            }
        }


        echo $form->dropDownList($model, 'cateid', $arr);
        ?>
        <?php echo $form->error($model, 'cateid'); ?>
    </div>
        <div class="clear"></div>
    <div class="form_left">
        <?php echo $form->labelEx($model, 'city'); ?>
    </div>
    <div class="form_right">
        <?php
        $doanluatsu = Doanluatsu::model()->findAll('flag =1 ');

       $list_ = CHtml::listData($doanluatsu, 'id', 'name');

        echo $form->dropDownList($model, 'city', $list_);
        ?>
        <?php echo $form->error($model, 'city'); ?>
    </div>


    


    <div class="clear"></div>
    <div class="form_left">

        <?php echo $form->labelEx($model, 'addfile'); ?>
    </div>
    <div class="form_right">
        <?php echo $form->dropDownList($model, 'addfile', array('0' => 'Không cho download', '1' => 'Cho phép download')); ?>
        <?php echo $form->error($model, 'addfile'); ?>
    </div>
    <div class="clear"></div>

    <div class="form_left">
        <?php echo $form->labelEx($model, 'hinh'); ?>
    </div>
    <div class="form_right">
        <?php echo $form->fileField($model, 'hinh', array('size' => 40, 'maxlength' => 100)); ?>
        <?php echo $form->error($model, 'hinh'); ?>
    </div>

    <div class="clear"></div>
    <div class="form_left">
        <?php echo $form->labelEx($model, 'fileaddname'); ?>
    </div>
    <div class="form_right">
        <?php echo $form->fileField($model, 'fileaddname', array('size' => 40, 'maxlength' => 100)); ?>
        <?php echo $form->error($model, 'fileaddname'); ?>
    </div>

    <div class="clear"></div>
    <?php
    $session = new CHttpSession;
    $session->open();
    if ($session['user_salesmart'][1] > 98) {
        ?>
        <div class="form_left">
            <?php echo $form->labelEx($model, 'flag'); ?>
        </div>
        <div class="form_right">

            <?php echo $form->dropDownList($model, 'flag', array('0' => 'Đang ẩn', '1' => 'Đang hiện')); ?>
        </div>
        <div class="clear"></div>
    <?php } ?>
    <div class="form_left">
        <?php echo $form->labelEx($model, 'gioithieu'); ?>
    </div>
    <div class="form_right">
        <?php echo $form->textArea($model, 'gioithieu', array('id' => 'editor1')); ?>
        <?php echo $form->error($model, 'gioithieu'); ?>
    </div>
    <div class="clear"></div>
     <div class="form_left">
        <?php echo $form->labelEx($model, 'sanpham'); ?>
    </div>
    <div class="form_right">
        <?php echo $form->textArea($model, 'sanpham', array('id' => 'editor2')); ?>
        <?php echo $form->error($model, 'sanpham'); ?>
    </div>
    <div class="clear"></div>
     <div class="form_left">
        <?php echo $form->labelEx($model, 'tinquangcao'); ?>
    </div>
    <div class="form_right">
        <?php echo $form->textArea($model, 'tinquangcao', array('id' => 'editor3')); ?>
        <?php echo $form->error($model, 'tinquangcao'); ?>
    </div>
    <div class="clear"></div>
     <div class="form_left">
        <?php echo $form->labelEx($model, 'chungnhan'); ?>
    </div>
    <div class="form_right">
        <?php echo $form->textArea($model, 'chungnhan', array('id' => 'editor4')); ?>
        <?php echo $form->error($model, 'chungnhan'); ?>
    </div>
    <div class="clear"></div>
     <div class="form_left">
        <?php echo $form->labelEx($model, 'tuyendung'); ?>
    </div>
    <div class="form_right">
        <?php echo $form->textArea($model, 'tuyendung', array('id' => 'editor5')); ?>
        <?php echo $form->error($model, 'tuyendung'); ?>
    </div>
    <div class="clear"></div>
     <div class="form_left">
        <?php echo $form->labelEx($model, 'nhanhieu'); ?>
    </div>
    <div class="form_right">
        <?php echo $form->textArea($model, 'nhanhieu', array('id' => 'editor6')); ?>
        <?php echo $form->error($model, 'nhanhieu'); ?>
    </div>
    <div class="clear"></div>
    <div class="form_left">.</div>
    <div class="row buttons">
        <?php echo CHtml::submitButton('Cập nhật'); ?>
    </div>

    <?php $this->endWidget(); ?>
    <script type="text/javascript">
        CKEDITOR.replace('editor1', {
            filebrowserBrowseUrl: '<?php echo Yii::app()->baseUrl; ?>/kcfinder/browse.php?type=files',
            filebrowserImageBrowseUrl: '<?php echo Yii::app()->baseUrl; ?>/kcfinder/browse.php?type=images',
            filebrowserFlashBrowseUrl: '<?php echo Yii::app()->baseUrl; ?>/kcfinder/browse.php?type=flash',
            filebrowserUploadUrl: '<?php echo Yii::app()->baseUrl; ?>/kcfinder/upload.php?type=files',
            filebrowserImageUploadUrl: '<?php echo Yii::app()->baseUrl; ?>/kcfinder/upload.php?type=images',
            filebrowserFlashUploadUrl: '<?php echo Yii::app()->baseUrl; ?>/kcfinder/upload.php?type=flash'
        });
    </script>
     <script type="text/javascript">
        CKEDITOR.replace('editor2', {
            filebrowserBrowseUrl: '<?php echo Yii::app()->baseUrl; ?>/kcfinder/browse.php?type=files',
            filebrowserImageBrowseUrl: '<?php echo Yii::app()->baseUrl; ?>/kcfinder/browse.php?type=images',
            filebrowserFlashBrowseUrl: '<?php echo Yii::app()->baseUrl; ?>/kcfinder/browse.php?type=flash',
            filebrowserUploadUrl: '<?php echo Yii::app()->baseUrl; ?>/kcfinder/upload.php?type=files',
            filebrowserImageUploadUrl: '<?php echo Yii::app()->baseUrl; ?>/kcfinder/upload.php?type=images',
            filebrowserFlashUploadUrl: '<?php echo Yii::app()->baseUrl; ?>/kcfinder/upload.php?type=flash'
        });
    </script>
     <script type="text/javascript">
        CKEDITOR.replace('editor3', {
            filebrowserBrowseUrl: '<?php echo Yii::app()->baseUrl; ?>/kcfinder/browse.php?type=files',
            filebrowserImageBrowseUrl: '<?php echo Yii::app()->baseUrl; ?>/kcfinder/browse.php?type=images',
            filebrowserFlashBrowseUrl: '<?php echo Yii::app()->baseUrl; ?>/kcfinder/browse.php?type=flash',
            filebrowserUploadUrl: '<?php echo Yii::app()->baseUrl; ?>/kcfinder/upload.php?type=files',
            filebrowserImageUploadUrl: '<?php echo Yii::app()->baseUrl; ?>/kcfinder/upload.php?type=images',
            filebrowserFlashUploadUrl: '<?php echo Yii::app()->baseUrl; ?>/kcfinder/upload.php?type=flash'
        });
    </script>
     <script type="text/javascript">
        CKEDITOR.replace('editor4', {
            filebrowserBrowseUrl: '<?php echo Yii::app()->baseUrl; ?>/kcfinder/browse.php?type=files',
            filebrowserImageBrowseUrl: '<?php echo Yii::app()->baseUrl; ?>/kcfinder/browse.php?type=images',
            filebrowserFlashBrowseUrl: '<?php echo Yii::app()->baseUrl; ?>/kcfinder/browse.php?type=flash',
            filebrowserUploadUrl: '<?php echo Yii::app()->baseUrl; ?>/kcfinder/upload.php?type=files',
            filebrowserImageUploadUrl: '<?php echo Yii::app()->baseUrl; ?>/kcfinder/upload.php?type=images',
            filebrowserFlashUploadUrl: '<?php echo Yii::app()->baseUrl; ?>/kcfinder/upload.php?type=flash'
        });
    </script>
     <script type="text/javascript">
        CKEDITOR.replace('editor5', {
            filebrowserBrowseUrl: '<?php echo Yii::app()->baseUrl; ?>/kcfinder/browse.php?type=files',
            filebrowserImageBrowseUrl: '<?php echo Yii::app()->baseUrl; ?>/kcfinder/browse.php?type=images',
            filebrowserFlashBrowseUrl: '<?php echo Yii::app()->baseUrl; ?>/kcfinder/browse.php?type=flash',
            filebrowserUploadUrl: '<?php echo Yii::app()->baseUrl; ?>/kcfinder/upload.php?type=files',
            filebrowserImageUploadUrl: '<?php echo Yii::app()->baseUrl; ?>/kcfinder/upload.php?type=images',
            filebrowserFlashUploadUrl: '<?php echo Yii::app()->baseUrl; ?>/kcfinder/upload.php?type=flash'
        });
    </script>
     <script type="text/javascript">
        CKEDITOR.replace('editor6', {
            filebrowserBrowseUrl: '<?php echo Yii::app()->baseUrl; ?>/kcfinder/browse.php?type=files',
            filebrowserImageBrowseUrl: '<?php echo Yii::app()->baseUrl; ?>/kcfinder/browse.php?type=images',
            filebrowserFlashBrowseUrl: '<?php echo Yii::app()->baseUrl; ?>/kcfinder/browse.php?type=flash',
            filebrowserUploadUrl: '<?php echo Yii::app()->baseUrl; ?>/kcfinder/upload.php?type=files',
            filebrowserImageUploadUrl: '<?php echo Yii::app()->baseUrl; ?>/kcfinder/upload.php?type=images',
            filebrowserFlashUploadUrl: '<?php echo Yii::app()->baseUrl; ?>/kcfinder/upload.php?type=flash'
        });
    </script>
</div><!-- form -->